#ifndef GROUNDWEATHERSTATIONFORM_H
#define GROUNDWEATHERSTATIONFORM_H

#include <QWidget>
#include <QSerialPort>
#include "../../protocol/groundweatherstationprotocol.h"

namespace Ui {
class GroundWeatherStationForm;
}

class GroundWeatherStationForm : public QWidget
{
    Q_OBJECT

public:
    explicit GroundWeatherStationForm(QWidget *parent = nullptr);
    ~GroundWeatherStationForm();


signals:
    void Sig_DeviceGroundWeatherStationProtocol(protocol::GroundWeatherStationProtocol);


private:
    QSerialPort* m_port;
    QByteArray m_readBuffer;

    void formInit();
    bool openDevice(QString portName);
    void closeDevice();
    void resolveProtrocol(QByteArray protocol);

    Ui::GroundWeatherStationForm *ui;
};

#endif // GROUNDWEATHERSTATIONFORM_H
